package com.jack.leetcode.eachProblem08;

public class 反转字符串中的单词 {

    public String reverseWords(String s) {
        String[] splitResult = s.split(" ");
        StringBuffer result = new StringBuffer();
        for (String split : splitResult) {
            result.append(new StringBuffer(split).reverse()).append(" ");
        }
        return result.toString().trim();
    }
}
